//23、定义一个矩形类（Rectangle），
// 包含长（length）和宽（width）属性，并实现计算面积和周长的方法。

package twentyThree;
import java.util.Scanner;

public class Rectangle {
    private int length;
    private int width;
    public Rectangle(int length,int width) {
        this.length=length;
        this.width=width;
    }
    public int getLength() {
        return length;
    }
    public void setLength(int length) {
        this.length = length;
    }
    public int getWidth() {
        return width;
    }
    public void setWidth(int width) {
        this.width = width;
    }
    public static void getArea(int length,int width) {
        int area=width*length;
        System.out.println("矩形的面积为："+area);
    }
    public static void main(String[] args) {
        System.out.println("请输入矩形的长和宽：");
        Scanner sc=new Scanner(System.in);
        int a=sc.nextInt();
        int b=sc.nextInt();
        getArea(a,b);
    }

}
